<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" import="com.neusoft.news.bean.User"%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>新闻网站应用系统</title>
    <meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

    <link rel="stylesheet" type="text/css" href="lib/bootstrap/css/bootstrap.css">
    
    <link rel="stylesheet" type="text/css" href="stylesheets/theme.css">
    <link rel="stylesheet" href="lib/font-awesome/css/font-awesome.css">

    <script src="lib/jquery-1.7.2.min.js" type="text/javascript"></script>

    <!-- Demo page code -->

    <style type="text/css">
        #line-chart {
            height:300px;
            width:800px;
            margin: 0px auto;
            margin-top: 1em;
        }
        .brand { font-family: georgia, serif; }
        .brand .first {
            color: #ccc;
            font-style: italic;
        }
        .brand .second {
            color: #fff;
            font-weight: bold;
        }
    </style>

    <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
      <script src="lib/html5.js"></script>
    <![endif]-->

    <!-- Le fav and touch icons -->
    <link rel="shortcut icon" href="../assets/ico/favicon.ico">
    <link rel="apple-touch-icon-precomposed" sizes="144x144" href="../assets/ico/apple-touch-icon-144-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="../assets/ico/apple-touch-icon-114-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="72x72" href="../assets/ico/apple-touch-icon-72-precomposed.png">
    <link rel="apple-touch-icon-precomposed" href="../assets/ico/apple-touch-icon-57-precomposed.png">
  </head>

  <!--[if lt IE 7 ]> <body class="ie ie6"> <![endif]-->
  <!--[if IE 7 ]> <body class="ie ie7 "> <![endif]-->
  <!--[if IE 8 ]> <body class="ie ie8 "> <![endif]-->
  <!--[if IE 9 ]> <body class="ie ie9 "> <![endif]-->
  <!--[if (gt IE 9)|!(IE)]><!--> 
  <body class=""> 
  <!--<![endif]-->
    
    <div class="navbar">
        <div class="navbar-inner">
                <ul class="nav pull-right">
        <%
			User user = (com.neusoft.news.bean.User)request.getAttribute("user");
		%>    
                    
                    <li id="fat-menu" class="dropdown">
                        <a href="#" role="button" class="dropdown-toggle" data-toggle="dropdown">
                            <i class="icon-user"></i><%=user.getUserName()%>
                            <i class="icon-caret-down"></i>
                        </a>

                        <ul class="dropdown-menu">
                            <li><a tabindex="-1" href="sign-in.jsp">Logout</a></li>
                        </ul>
                    </li>
                    
                </ul>
                <a class="brand" href="userindex.jsp"><span class="first">新闻网站</span></a>
        </div>
    </div>
    


    
    <div class="sidebar-nav">
        <a href="#dashboard-menu" class="nav-header" data-toggle="collapse"><i class="icon-dashboard"></i>用户管理</a>
        <ul id="dashboard-menu" class="nav nav-list collapse in">
            <li><a href="UserServlet?username=<%=user.getUserName()%>&password=<%=user.getUserPwd()%>&level=<%=user.getUserLevel()%>">用户审核</a></li>
            <li class="active"><a href="UserKanriServlet?userid=<%=user.getUserId()%>">用户维护</a></li>
            <li ><a href="UserEditServlet?userid=<%=user.getUserId()%>">用户修改</a></li>
            
        </ul>
    </div>
    

    
    <div class="content">
        
        <div class="header">
            
            <h1 class="page-title">用户维护</h1>
        </div>
        
                <ul class="breadcrumb">
            <li><a href="userindex.jsp">用户管理</a> <span class="divider">/</span></li>
            <li class="active">用户维护</li>
        </ul>

        <div class="container-fluid">
            <div class="row-fluid">
                    
<div class="btn-toolbar">
    <a class="btn btn-primary" href="#myModal" data-toggle="modal"><i class="icon-plus"></i> New User</a>
  <div class="btn-group">
  </div>
</div>
<div class="well">
    <table class="table">
      <thead>
        <tr>
          <th>序号</th>
          <th>用户姓名</th>
          <th>用户性别</th>
          <th>出生日期</th>
          <th>联系方式</th>
          <th>用户住址</th>
          <th>用户权限</th>
          <th style="width: 35px;">操作</th>
        </tr>
      </thead>
      <tbody>
<%
	java.util.List<User> users = (java.util.List)request.getAttribute("users");
	int i = 1;
	if(users!=null){
%>
        <tr>
        <%for(User userlist:users){ %>
          <td><%=i++%></td>
          <td><%=userlist.getUserName()%></td>
          <%if("1".equals(userlist.getUserSex())){%>
          <td>男</td>
          <%}else{%>
          <td>女</td>
          <%} %>
          <td><%=userlist.getUserBrithday()%></td>
          <td><%=userlist.getUserTel()%></td>
          <td><%=userlist.getUserAddr()%></td>
           <%if("1".equals(userlist.getUserLevel())){%>
          <td>编辑</td>
          <%}else{%>
          <td>读者</td>
          <%} %>
          <td>
              <a href="RemoveUserServlet?userid=<%=userlist.getUserId()%>&loginid=<%=user.getUserId()%>"><i class="icon-remove"></i></a>
          </td>          
        </tr>
        <%} %>
 <%} %>       
      </tbody>
    </table>
</div>
<div class="pagination">
    <ul>
        <li><a href="#">Prev</a></li>
        <li><a href="#">1</a></li>
        <li><a href="#">2</a></li>
        <li><a href="#">3</a></li>
        <li><a href="#">4</a></li>
        <li><a href="#">Next</a></li>
    </ul>
</div>


            </div>
        </div>
    </div>
    
<div class="modal small hide fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
    <h3 id="myModalLabel">新建用户信息</h3>
  </div>

  <div class="modal-body">  
      <form id="tab" action="UserCreateServlet" method="post">
      	<input type="hidden" value="<%=user.getUserId()%>" class="input-xlarge" name="loginid">
        <label>用户名</label>
        <input type="text" value="" class="input-xlarge" name="username">
        <label>密码</label>
        <input type="password" value="" class="input-xlarge" name="password">
        <label>性别</label>
        <label style="width: 100px;"><input name="sex" type="radio" value="1" /> 男 
				<input name="sex" type="radio" value="2" /> 女 </label>
        <label>出生日期</label>
        <input type="date" value="" class="input-xlarge" name="brithday">
        <label>手机号码</label>
        <input type="text" value="" class="input-xlarge" name="tel">
        <label>用户地址</label>
        <input type="text" value="" class="input-xlarge" name="address">
        <label >用户权限</label>
        <label><input name="level" type="radio" value="1" /> 编辑 
				<input name="level" type="radio" value="2" /> 读者
		</label>
		<label ></label>
 		<input type="submit" class="btn btn-primary" value="提交" name="type">
		<button class="btn btn-danger" data-dismiss="modal">取消</button>
    </form>
  </div>
</div>  


    <script src="lib/bootstrap/js/bootstrap.js"></script>
    <script type="text/javascript">
        $("[rel=tooltip]").tooltip();
        $(function() {
            $('.demo-cancel-click').click(function(){return false;});
        });
    </script>
    
  </body>
</html>